package com.alibaba.p3c.pmd.lang.java.rule;

import com.alibaba.p3c.pmd.lang.java.rule.oop.BigDecimalAvoidDoubleConstructorRule;
import net.sourceforge.pmd.Rule;
import net.sourceforge.pmd.testframework.RuleTst;
import net.sourceforge.pmd.testframework.SimpleAggregatorTst;
import net.sourceforge.pmd.testframework.TestDescriptor;
import org.junit.Test;

import java.util.List;

public class OopRuleTest extends SimpleAggregatorTst {

    /**
     * 加载CLASSPATH下的rulesets/java/ali-oop.xml
     */
    private static final String RULESET = "java-ali-oop";

    @Override
    public void setUp() {
        addRule(RULESET, "EqualsAvoidNullRule");
        addRule(RULESET, "WrapperTypeEqualityRule");
        addRule(RULESET, "PojoNoDefaultValueRule");
        addRule(RULESET, "PojoMustUsePrimitiveFieldRule");
        addRule(RULESET, "PojoMustOverrideToStringRule");
        addRule(RULESET, "StringConcatRule");
        addRule(RULESET, "BigDecimalAvoidDoubleConstructorRule");
    }

    @Override
    public List<Rule> getRules() {
        return super.getRules();
    }


}